package com.baeldung.bidirect;

import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.JsonManagedReference;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;

/**
 * Created by dzy on 2018/9/1
 */
public class Item {
  public int id;
  public String itemName;

  // 是引用的前向部分 - 正常序列化的部分
  @JsonManagedReference
  public User owner;

  public Item(int id, String itemName, User user) {
    this.id=id;
    this.itemName = itemName;
    this.owner = user;
  }
}
